#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTreeWidget>
#include "libvcard/vcard.h"
#include "loadingDialog.h"
#include "loadingthread.h"
#include "qmobex/qmobex.h"

namespace Ui {
    class MainWindow;

}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

signals:
    void openModem(QString);

public slots:
    void openLocalFiles();
    void   setPort(QString &port);
    void setModel(QString &model);

private:
    Ui::MainWindow *ui;//User interface
    //declare modem
    QMobex mobex;
    LoadingDialog *dialog;
    //Contacts tables
    // < ID, vCard object>
    vCardHash contactsPhone;//Phone
    vCardHash contactsSim;//SIM Card
    vCardList contactsFile; // contacts from file
    QString qoutedPrintableEncode(QString);
        private slots:
    void on_deleteContactSim_clicked();
    void on_deleteContactPhone_clicked();
    void on_actionBackupPhonebook_triggered();
    void backupContacts(QByteArray memory);

    void on_actionAbout_Qt_triggered();
    void openPort();
    void closePort();
    void showCurrentMode(int);
    void loadContactsPhone();
    void loadContactsSim();
    void reloadList(vCardHash &data, QTreeWidget *view );
    void reloadListPhone();
    void reloadListSim();
    void savePhonebook();
    void saveSimPhonebook();
    void displayItem(QTreeWidgetItem* item);
};



#endif // MAINWINDOW_H
